function test() {
    var numListEl1 = document.getElementsByClassName("numList1");
    var list1 = getNumArr(numListEl1);
    var numListEl2 = document.getElementsByClassName("numList2");
    var list2 = getNumArr(numListEl2);
    var numListEl3 = document.getElementsByClassName("numList3");
    var list3 = getNumArr(numListEl3);
    
    go(list1, 1);
    go(list2, 2);
    go(list3, 3);
}
function go(array, list) {
    var nums = getNums2(array);
    var total = findN(nums);

	var mean = findMean(nums, total);
    var median = findMedian(nums);
    var mode = findMode(nums);
    var variance = findVariance(nums, mean);
    var std = findStandardDeviation(variance);
    
    popFrmResults(getList(list), mean, median, mode, variance, std);
}
function getNums2(array) {
    for (i = 0; i < array.length; i++)
        array[i] = parseFloat(array[i], 10);
    array.sort(function(a,b){return a-b;});
    return array;
}
function popFrmResults(list, mean, median, mode, variance, std) {
    var meanN = document.createElement("li");
    meanN.innerHTML = "Mean: " + mean.toFixed(2);
    var medianN = document.createElement("li");
    medianN.innerHTML = "Median: " + median.toFixed(2);
    var modeN = document.createElement("li");
    modeN.innerHTML = "Mode: " + mode;
    var varN = document.createElement("li");
    varN.innerHTML = "Sample Variance: " + variance.toFixed(2);
    var stdN = document.createElement("li");
    stdN.innerHTML = "Sample Std Deviation: " + std.toFixed(2);
    
    list.appendChild(meanN);
    list.appendChild(medianN);
    list.appendChild(modeN);
    list.appendChild(varN);
    list.appendChild(stdN);                
}
function getList(listNum) {
    var listEl;
    switch(listNum) {
        case(1):
            listEl = document.getElementById("frmList1");
            break;
        case(2):
            listEl = document.getElementById("frmList2");
            break;
        case(3):
            listEl = document.getElementById("frmList3");
            break;
    }
    return listEl;
}
function getNumArr(array) {
    var list = [];
    for (var i = 0; i < array.length; i++)
        list[i] = array[i].innerHTML;
    return list;
}